package com.yingwei.mining.appletversion;

import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: yingwei
 * Date: 2009-11-15
 * Time: 21:54:46
 * To change this template use File | Settings | File Templates.
 */
abstract public class Device
{
    private double strength;
    private String id;
 
    public double getStrength()
    {
        return strength;
    }

    public void setStrength(double strength)
    {
        this.strength = strength;
    }
    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    private Position position;
    private Image image;
    private final static int compareFacotr = 5;

    public boolean isOnThis( int x, int y )
    {
        if( x > position.getX()-compareFacotr  && x < position.getX() + compareFacotr  &&
            y > position.getY()-compareFacotr  && y < position.getY() + compareFacotr )
        {
            return true;
        }
        else
        {
            return false;
        }

    }

    public Position getPosition() {
        return position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public Image getImage() {
        return image;
    }

    public void setImage(Image image) {
        this.image = image;
    }
}
